import numpy as np


x = \
0.1*0.3*0.3*0.6*0.6*0.4+\
0.3*0.3*0.4*0.6*0.6*0.6+\
0.6*0.1*0.4*0.6*0.6*0.4+\
0.2*0.1*0.3*0.6*0.4*0.4+\
0.3*0.6*0.3*0.6*0.6*0.4+\
0.1*0.6*0.4*0.4*0.6*0.4+\
0.6*0.2*0.3*0.4*0.6*0.4+\
0.2*0.2*0.6*0.4*0.4*0.4
print(x)

y = \
0.3*0.3*0.3*0.6*0.6*0.4+\
0.4*0.3*0.4*0.6*0.6*0.6+\
0.3*0.1*0.4*0.6*0.6*0.4+\
0.6*0.1*0.3*0.6*0.4*0.4+\
0.4*0.6*0.3*0.6*0.6*0.4+\
0.3*0.6*0.4*0.4*0.6*0.4+\
0.3*0.2*0.3*0.4*0.6*0.4+\
0.6*0.2*0.6*0.4*0.4*0.4
print(y)
z = \
0.6*0.3*0.3*0.6*0.6*0.4+\
0.3*0.3*0.4*0.6*0.6*0.6+\
0.1*0.1*0.4*0.6*0.6*0.4+\
0.2*0.1*0.3*0.6*0.4*0.4+\
0.3*0.6*0.3*0.6*0.6*0.4+\
0.6*0.6*0.4*0.4*0.6*0.4+\
0.1*0.2*0.3*0.4*0.6*0.4+\
0.2*0.2*0.6*0.4*0.4*0.4
print(z)
print(x/(x+y+z),y/(x+y+z),z/(x+y+z))
print(256+368+376)
"""


data = np.array([1,1,2,3,4,4,5])
print(sum(data==2))


import random
import matplotlib.pyplot as plt

buf = np.arange(30)
batch_size = 7

def batch_reader():
    drop_last = False
    # 样本数据打乱
    random.shuffle(buf)
    # 每次迭代提供batch_size个样本
    b = []
    for instance in buf:
        b.append(instance)
        if len(b) == batch_size:
            yield b
            b = []
    if drop_last is False and len(b) != 0:
        yield b

# for i in range(35):
#     for data in batch_reader():
#         print(data)

str = 'abcdefghi'
dt = []
for i,ct in enumerate(str):
    dt.append([ct,i])
print(dt)
print(dict(dt))

"""